﻿#Requires AutoHotkey v2.0
#SingleInstance Force

#Include utils/graphic.ahk
#Include utils/base.ahk

main() {
    swit_btn := XImage("switch_button.png")
    save_btn := XImage("save_button.png")

    suc_times := 0
    fai_times := 0
    while true {
        X.print("[*] in search...")
        coord := swit_btn.waitShowUp(1200000, "*32")
        if coord.isValid() {
            suc_times += 1
            coord.clickL()
            sleep(random(100, 500))
            save_btn.find().clickL()
        } else {
            fai_times += 1
        }
        sleep_time := random(1200000, 1800000)
        X.print("[+] success", suc_times, "times, fail", fai_times, "times, sleep", X.round(sleep_time / 60000, 2), "minutes`n")
        sleep(sleep_time)
    }
}

main()